package com.ssh.entity;

import java.sql.Timestamp;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Petdiary entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name="petdiary")
public class Petdiary implements java.io.Serializable {

	// Fields

	private Integer diaryId;
	private Petinfo petinfo;
	private Timestamp diaryDate;
	private String diaryTitle;
	private String diaryWeather;
	private String diaryContext;
	private String diaryIsPublic;
	private Timestamp diaryLastModify;
	private String diaryAuthor;
	private String diaryAuthorEmail;

	// Constructors

	/** default constructor */
	public Petdiary() {
	}

	/** minimal constructor */
	public Petdiary(Petinfo petinfo) {
		this.petinfo = petinfo;
	}

	/** full constructor */
	public Petdiary(Petinfo petinfo, Timestamp diaryDate, String diaryTitle,
			String diaryWeather, String diaryContext, String diaryIsPublic,
			Timestamp diaryLastModify, String diaryAuthor,
			String diaryAuthorEmail) {
		this.petinfo = petinfo;
		this.diaryDate = diaryDate;
		this.diaryTitle = diaryTitle;
		this.diaryWeather = diaryWeather;
		this.diaryContext = diaryContext;
		this.diaryIsPublic = diaryIsPublic;
		this.diaryLastModify = diaryLastModify;
		this.diaryAuthor = diaryAuthor;
		this.diaryAuthorEmail = diaryAuthorEmail;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public Integer getDiaryId() {
		return this.diaryId;
	}

	public void setDiaryId(Integer diaryId) {
		this.diaryId = diaryId;
	}
	@ManyToOne(cascade={CascadeType.PERSIST,CascadeType.REFRESH})
	@JoinColumn(name="pet_id")
	public Petinfo getPetinfo() {
		return this.petinfo;
	}

	public void setPetinfo(Petinfo petinfo) {
		this.petinfo = petinfo;
	}

	public Timestamp getDiaryDate() {
		return this.diaryDate;
	}

	public void setDiaryDate(Timestamp diaryDate) {
		this.diaryDate = diaryDate;
	}

	public String getDiaryTitle() {
		return this.diaryTitle;
	}

	public void setDiaryTitle(String diaryTitle) {
		this.diaryTitle = diaryTitle;
	}

	public String getDiaryWeather() {
		return this.diaryWeather;
	}

	public void setDiaryWeather(String diaryWeather) {
		this.diaryWeather = diaryWeather;
	}

	public String getDiaryContext() {
		return this.diaryContext;
	}

	public void setDiaryContext(String diaryContext) {
		this.diaryContext = diaryContext;
	}

	public String getDiaryIsPublic() {
		return this.diaryIsPublic;
	}

	public void setDiaryIsPublic(String diaryIsPublic) {
		this.diaryIsPublic = diaryIsPublic;
	}

	public Timestamp getDiaryLastModify() {
		return this.diaryLastModify;
	}

	public void setDiaryLastModify(Timestamp diaryLastModify) {
		this.diaryLastModify = diaryLastModify;
	}

	public String getDiaryAuthor() {
		return this.diaryAuthor;
	}

	public void setDiaryAuthor(String diaryAuthor) {
		this.diaryAuthor = diaryAuthor;
	}

	public String getDiaryAuthorEmail() {
		return this.diaryAuthorEmail;
	}

	public void setDiaryAuthorEmail(String diaryAuthorEmail) {
		this.diaryAuthorEmail = diaryAuthorEmail;
	}

	@Override
	public String toString() {
		return "Petdiary [diaryAuthor=" + diaryAuthor + ", diaryAuthorEmail="
				+ diaryAuthorEmail + ", diaryContext=" + diaryContext
				+ ", diaryDate=" + diaryDate + ", diaryId=" + diaryId
				+ ", diaryIsPublic=" + diaryIsPublic + ", diaryLastModify="
				+ diaryLastModify + ", diaryTitle=" + diaryTitle
				+ ", diaryWeather=" + diaryWeather + "]";
	}

}